import java.awt.Insets;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;

public class SummaryWindow extends JFrame {
private Question q;

	public SummaryWindow(Question q){
		super("Summary");
		this.q = q;
		JTextArea summary = new JTextArea();
		summary.setMargin(new Insets(10,10,10,10));
		summary.setText(q.getSummary());
		summary.setLineWrap(true);
		summary.setWrapStyleWord(true);
		this.add(summary);
		
		JScrollPane scroll = new JScrollPane (summary);
	    scroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS );
	    this.add ( scroll );
	    
		this.pack();
		this.setVisible(true);
		
	}
	
}
